package com.epoint.clubmanagement.mapper;

import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.epoint.clubmanagement.entity.Club;
import com.epoint.clubmanagement.vo.ClubVO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

/**
 * Title: ClubMapper
 * Description: 俱乐部的增删改查Mapper
 *
 * @author sqn
 * @version 1.0.0
 * @date 2021/3/17 0017 下午 12:05
 */
@Mapper
public interface ClubMapper extends BaseMapper<Club> {

    /**
     * @param page 翻页对象，可以作为 xml 参数直接使用，传递参数 Page 即自动分页
     * @return List<ClubVO>
     */
    @Select("SELECT c.id,c.club_name,c.club_leader,c.type_id,ct.id,ct.type_name,c.createtime,c.number_of_activities,c.number_of_members FROM club c join club_type ct on c.type_id = ct.id " + "${ew.customSqlSegment}")
    IPage<ClubVO> queryClubVOByPage(IPage<ClubVO> page, @Param("ew") Wrapper queryWrapper);

}
